package com.zx.lean_ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

import com.zx.lean_ui.R;


public class BlankFragment extends Fragment {
    private View root;
    private TextView textview;
    private Button btn;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        if (root == null) root = inflater.inflate(R.layout.fragment_blank, container, false);
        initView(root);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                textview.setText("yes i am,and you ");
            }
        });
        return root;
    }

    private void initView(View root) {
        textview = root.findViewById(R.id.textview);
        btn = root.findViewById(R.id.btn);
    }
}